package co.yixiang.modules.system.service;

import co.yixiang.common.service.BaseService;
import co.yixiang.modules.system.domain.LoanPlan;
import co.yixiang.modules.system.dto.LoanPlanDto;
import co.yixiang.modules.system.dto.queryCriteria.LoanPlanQueryCriteria;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @author zf
 * @date 2021-10-10
 */
public interface LoanPlanService extends BaseService<LoanPlan> {

    /**
     * 查询数据分页
     *
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String, Object>
     */
    Map<String, Object> queryAll(LoanPlanQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     *
     * @param criteria 条件参数
     * @return List<LoanPlanDto>
     */
    List<LoanPlan> queryAll(LoanPlanQueryCriteria criteria);

    /**
     * 导出数据
     *
     * @param all      待导出的数据
     * @param response /
     * @throws IOException /
     */
    void download(List<LoanPlanDto> all, HttpServletResponse response) throws IOException;

    @Transactional
    void check(LoanPlan resources) throws Exception;
}
